package com.guodu.vo;

import java.math.BigDecimal;

import com.guodu.entity.MaterialGhyctj;
import com.guodu.entity.ViewMaterialGhyc;

public class ViewMaterialGhycVo {

	private String funitsName;
	private String unitsName;
	private BigDecimal cgMoney;
	private BigDecimal allCgMoney;
	private BigDecimal beforeCgMoney;
	private BigDecimal subCgMoney;
	private BigDecimal xhMoney;
	private BigDecimal allXhMoney;
	private BigDecimal beforeXhMoney;
	private BigDecimal subXhMoney;
	private BigDecimal beginMoney;
	private BigDecimal endMoney;
	private BigDecimal beforeKcMoney;
	private BigDecimal subKcMoney;
	private Long status;
	private String tjId;
	private Long funitsId;
	private Long unitsId;
	
	public ViewMaterialGhycVo(){
		
	}

	public ViewMaterialGhycVo(ViewMaterialGhyc view){
		this.funitsId=view.getFunitsId();
		this.unitsId=view.getUnitsId();
		this.allCgMoney=view.getAllCgMoney();
		this.allXhMoney=view.getAllXhMoney();
		this.cgMoney=view.getCgMoney();
		this.xhMoney=view.getXhMoney();
		this.beginMoney=view.getBeginMoney();
		this.endMoney=view.getEndMoney();
	}	
	
	public ViewMaterialGhycVo(MaterialGhyctj materialGhyctj){
		this.funitsId = materialGhyctj.getFunitsId();
		this.unitsId = materialGhyctj.getUnitsId();
		this.cgMoney = materialGhyctj.getBycg();
		this.allCgMoney = materialGhyctj.getLjcg();
		this.beforeCgMoney = materialGhyctj.getQntqcg();
		this.subCgMoney =(materialGhyctj.getLjcg()!=null?materialGhyctj.getLjcg():new BigDecimal(0)).subtract(materialGhyctj.getQntqcg()!=null?materialGhyctj.getQntqcg():new BigDecimal(0));
		this.xhMoney = materialGhyctj.getByxh();
		this.allXhMoney = materialGhyctj.getLjxh();
		this.beforeXhMoney = materialGhyctj.getQntqxhj();
		this.subXhMoney = (materialGhyctj.getLjxh()!=null?materialGhyctj.getLjxh():new BigDecimal(0)).subtract(materialGhyctj.getQntqxhj()!=null?materialGhyctj.getQntqxhj():new BigDecimal(0));
		this.beginMoney = materialGhyctj.getSymkc();
		this.endMoney = materialGhyctj.getBymkc();
		this.beforeKcMoney = materialGhyctj.getQntqkc();
		this.subKcMoney = (materialGhyctj.getBymkc()!=null?materialGhyctj.getBymkc():new BigDecimal(0)).subtract(materialGhyctj.getQntqkc()!=null?materialGhyctj.getQntqkc():new BigDecimal(0));
	}
	
	public ViewMaterialGhycVo(ViewMaterialGhycVo view1,ViewMaterialGhycVo view2){
		this.funitsId = view1.getFunitsId();
		this.unitsId = view1.getUnitsId();
		this.cgMoney = view1.getCgMoney();
		this.allCgMoney = view1.getAllCgMoney();
		this.beforeCgMoney = view2.getCgMoney();
		if(view1.getCgMoney()!=null&&view2.getCgMoney()!=null){
		this.subCgMoney =  view1.getAllCgMoney().subtract(view2.getAllCgMoney());
		}
		this.xhMoney = view1.getXhMoney();
		this.allXhMoney = view1.getAllXhMoney();
		this.beforeXhMoney = view2.getXhMoney();
		if(view1.getXhMoney()!=null&&view2.getXhMoney()!=null){
			this.subXhMoney = view1.getAllXhMoney().subtract(view2.getAllXhMoney());
		}
		this.beginMoney = view1.getBeginMoney();
		this.endMoney = view1.getEndMoney();
		this.beforeXhMoney = view2.getEndMoney();
		if(view1.getEndMoney()!=null&&view2.getEndMoney()!=null){
			this.subKcMoney = view1.getEndMoney().subtract(view2.getEndMoney());
		}
	}
	
	public ViewMaterialGhycVo(ViewMaterialGhycVo view1,MaterialGhyctj view2){
		this.funitsId = view1.getFunitsId();
		this.unitsId = view1.getUnitsId();
		this.cgMoney = view1.getCgMoney();
		this.allCgMoney = view1.getAllCgMoney();
		this.beforeCgMoney = view2.getBycg();
		if(view1.getCgMoney()!=null&&view2.getBycg()!=null){
		this.subCgMoney =  view1.getAllCgMoney().subtract(view2.getLjcg());
		}
		this.xhMoney = view1.getXhMoney();
		this.allXhMoney = view1.getAllXhMoney();
		this.beforeXhMoney = view2.getByxh();
		if(view1.getXhMoney()!=null&&view2.getByxh()!=null){
			this.subXhMoney = view1.getAllXhMoney().subtract(view2.getLjxh());
		}
		this.beginMoney = view1.getBeginMoney();
		this.endMoney = view1.getEndMoney();
		this.beforeXhMoney = view2.getBymkc();
		if(view1.getEndMoney()!=null&&view2.getBymkc()!=null){
			this.subKcMoney = view1.getEndMoney().subtract(view2.getBymkc());
		}
	}
	
	
	
	public String getTjId() {
		return tjId;
	}

	public void setTjId(String tjId) {
		this.tjId = tjId;
	}

	public String getFunitsName() {
		return funitsName;
	}

	public void setFunitsName(String funitsName) {
		this.funitsName = funitsName;
	}

	public String getUnitsName() {
		return unitsName;
	}

	public void setUnitsName(String unitsName) {
		this.unitsName = unitsName;
	}

	public Long getStatus() {
		return status;
	}

	public void setStatus(Long status) {
		this.status = status;
	}

	public Long getFunitsId() {
		return funitsId;
	}
	public void setFunitsId(Long funitsId) {
		this.funitsId = funitsId;
	}
	public Long getUnitsId() {
		return unitsId;
	}
	public void setUnitsId(Long unitsId) {
		this.unitsId = unitsId;
	}
	public BigDecimal getCgMoney() {
		return cgMoney;
	}
	public void setCgMoney(BigDecimal cgMoney) {
		this.cgMoney = cgMoney;
	}
	public BigDecimal getAllCgMoney() {
		return allCgMoney;
	}
	public void setAllCgMoney(BigDecimal allCgMoney) {
		this.allCgMoney = allCgMoney;
	}
	public BigDecimal getBeforeCgMoney() {
		return beforeCgMoney;
	}
	public void setBeforeCgMoney(BigDecimal beforeCgMoney) {
		this.beforeCgMoney = beforeCgMoney;
	}
	public BigDecimal getSubCgMoney() {
		return subCgMoney;
	}
	public void setSubCgMoney(BigDecimal subCgMoney) {
		this.subCgMoney = subCgMoney;
	}
	public BigDecimal getXhMoney() {
		return xhMoney;
	}
	public void setXhMoney(BigDecimal xhMoney) {
		this.xhMoney = xhMoney;
	}
	public BigDecimal getAllXhMoney() {
		return allXhMoney;
	}
	public void setAllXhMoney(BigDecimal allXhMoney) {
		this.allXhMoney = allXhMoney;
	}
	public BigDecimal getBeforeXhMoney() {
		return beforeXhMoney;
	}
	public void setBeforeXhMoney(BigDecimal beforeXhMoney) {
		this.beforeXhMoney = beforeXhMoney;
	}
	public BigDecimal getSubXhMoney() {
		return subXhMoney;
	}
	public void setSubXhMoney(BigDecimal subXhMoney) {
		this.subXhMoney = subXhMoney;
	}
	public BigDecimal getBeginMoney() {
		return beginMoney;
	}
	public void setBeginMoney(BigDecimal beginMoney) {
		this.beginMoney = beginMoney;
	}
	public BigDecimal getEndMoney() {
		return endMoney;
	}
	public void setEndMoney(BigDecimal endMoney) {
		this.endMoney = endMoney;
	}
	public BigDecimal getBeforeKcMoney() {
		return beforeKcMoney;
	}
	public void setBeforeKcMoney(BigDecimal beforeKcMoney) {
		this.beforeKcMoney = beforeKcMoney;
	}
	public BigDecimal getSubKcMoney() {
		return subKcMoney;
	}
	public void setSubKcMoney(BigDecimal subKcMoney) {
		this.subKcMoney = subKcMoney;
	}
	
	
	
}
